<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Base Sprite</title>
  <style>
    @keyframes myfirst
    {
      0%   {background: red;}
      25%  {background: yellow;}
      50%  {background: blue;}
      100% {background: green;}
    }
    @keyframes test
    {
      from {color: red;}
      to {color: yellow;}
    }
    html, document {
      font-size: 32px;
    }
    layer.abc {
      font: bold 32px serif;
      /* background-color: black; */
    }
    /* group.list {
      --sprite-pos: 100, 50;
    } */
    group.list > label {
      --sprite-anchor: center;
      --sprite-x: 100;
    }
    group.list > label:nth-child(2n+1) {
      color: #f37;
      --sprite-scale: 1.5,1.5;
      /* transition: all 1s; */
      animation: myfirst 2s;
    }
    group.list > label:nth-child(2n) {
      --sprite-gradient: color vector(0, 0, 70, 70) 0,red 0.5,yellow 1,green;
      /* color: yellow; */
      transition: all 1s;
    }
    group.list > label.test {
      animation: test 2s;
    }
  </style>
</head>
<body>
  <canvas id="mycanvas" width="1200" height="1200"></canvas>
  <!-- <script src="https://unpkg.com/sprite-core@2.26.15/dist/sprite-core.min.js"></script> -->
  <script src="/js/sprite-core.js"></script>
  <script>
const {Layer, Group, Label} = spritejs;
const context = document.getElementById('mycanvas').getContext('2d');
const layer = new Layer({context, useDocumentCSS: true});
layer.className = 'abc';

const group = new Group();
group.attr({
  class: 'list',
  // fontSize: 16,
  // bgcolor: 'black',
});

layer.append(group);

for(let i = 0; i < 10; i++) {
  const s = new Label(`line ${i}`);
  s.attr({
    y: 50 + i * 50,
    border: [1, 'cyan'],
  });
  group.append(s);
}
  </script>
</body>
</html>